class CombatDrugsAltFire extends WeaponFire;

var float InjectDelay;
var float HealeeRange;

function DoFireEffect()
{
	SetTimer(InjectDelay, False);
}

Function Timer()
{
    Weapon.ConsumeAmmo(CombatDrugs(Weapon).SelectedAmmoType, 1);
	CombatDrugs(Weapon).AfflictTarget(Instigator);
}

function bool AllowFire()
{
	if ( KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ClientVeteranSkill.default.PerkIndex != class'SRVetFieldMedic'.default.PerkIndex )
	{
		return false;
	}

    return Weapon.AmmoAmount(CombatDrugs(Weapon).SelectedAmmoType) >= 1;
}

event ModeDoFire()
{
	local float Rec;

	Rec = GetFireSpeed();
	FireRate = default.FireRate/Rec;
	FireAnimRate = default.FireAnimRate*Rec;
	ReloadAnimRate = default.ReloadAnimRate*Rec;
	Load = 0;

	Super.ModeDoFire();
}

function float GetFireSpeed()
{
	local SRPlayerReplicationInfo SRPRI;
	
	SRPRI = SRPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
	
	return class<SRVeterancy>(SRPRI.ClientVeteranSkill).Static.GetFireModeSpeed(SRPRI,Self.Class);
}

function PlayFiring()
{
	if ( Weapon.Mesh != None )
	{
		Weapon.PlayAnim(FireAnim, FireAnimRate, TweenTime);
		CombatDrugs(Weapon).bDoingFireAnim = true;
	}
    Weapon.PlayOwnedSound(FireSound,SLOT_Interact,TransientSoundVolume,,TransientSoundRadius,Default.FireAnimRate/FireAnimRate,false);
    ClientPlayForceFeedback(FireForce);

    FireCount++;
}

defaultproperties
{
	AmmoClass=Class'CombatDrugsAnalgeticAmmo'

    InjectDelay=0.100000
    HealeeRange=70.000000
    TransientSoundVolume=1.800000
    FireAnim="InjectSelf"
    FireRate=3.600000
    AmmoPerFire=1
}
